package org.example.curriculum_design_6_16.service;

import org.example.curriculum_design_6_16.entity.pojo.CompetitionParticipation;
import com.baomidou.mybatisplus.extension.service.IService;
import org.example.curriculum_design_6_16.entity.vo.CompetitionParticipationVo;
import org.example.curriculum_design_6_16.entity.vo.Result;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author 郑凯
* @description 针对表【competition_participation】的数据库操作Service
* @createDate 2025-06-22 21:30:17
*/
public interface CompetitionParticipationService extends IService<CompetitionParticipation> {
    List<CompetitionParticipationVo> getAllParticipations();
    CompetitionParticipationVo getParticipationById(Integer id);
    List<CompetitionParticipationVo> getParticipationsByStudentId(String studentId);
    List<CompetitionParticipationVo> getParticipationsByStudentIdAndYear(String studentId, String academicYear);
    List<CompetitionParticipationVo> getParticipationsByCompetitionId(Integer competitionId);
    int addParticipation(CompetitionParticipation participation);
    int updateParticipation(CompetitionParticipation participation);
    int deleteParticipation(Integer id);
    int approveParticipation(Integer id, String reviewComment);
    int rejectParticipation(Integer id, String reviewComment);
    double getSum(String studentId);
    
    /**
     * 获取学生在指定学年的学科竞赛总分
     * @param studentId 学生ID
     * @param academicYear 学年
     * @return 学科竞赛总分
     */
    double getSum(String studentId, String academicYear);
}
